﻿using Pap.Data.Abstraction.Utils;

namespace Pap.Data.LToS.Utils
{
    /// <summary>
    /// 
    /// </summary>
    public class UnitOfWork : IUnitOfWork
    {
        /// <summary>
        /// 
        /// </summary>
        ISubmitChanges _SubmitChanges;
        /// <summary>
        /// Initializes a new instance of the <see cref="UnitOfWork"/> class.
        /// </summary>
        /// <param name="submitChanges">The submit changes.</param>
        public UnitOfWork(ISubmitChanges submitChanges)
        {
            _SubmitChanges = submitChanges;
        }

        #region IUnitOfWork Members

        /// <summary>
        /// Commits this instance.
        /// </summary>
        public void Commit()
        {
            _SubmitChanges.SubmitChanges();
        }

        #endregion

        #region IDisposable Members

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {

        }

        #endregion
    }
}
